<?
	$oModBase =& loadModule('base');
	$cUlrImagenes = $oModBase->getUrlImages();
	$cRefresh = getParam(PARAM_REFRESH);
?><script  type='text/javascript'>window.setInterval( "send( '?rf=head' , refreshElement, 'head' , false, false);", 300000);
function refreshHead()
	{
		if ( gcElement == '')
		{
			goXHR =createXMLHttpRequest();
			cBody = null;
			goXHR.open("GET", '?mo=administracion&ac=179', false );
			goXHR.send( null );
			cHtml = goXHR.responseText;
			oElement = id( 'bandeja_mensajes' );
			oElement.innerHTML = cHtml ;
		}
	}
function swapMenu( oThis)
{
	oLeft = document.getElementById ( 'body_left' );
	oBody = document.getElementById ( 'body_main' );
	if ( oLeft.style.display == 'none' )
	{
		oLeft.style.display=   'block' ;
		oBody.style.width = '760px';
		oThis.innerHTML=   '<img border=0  src=\'<?=  $cUlrImagenes ?>/siguiente.gif\' />' ;
	} else
	{
		oLeft.style.display=   'none' ;
		oBody.style.width = '960px';
		oThis.innerHTML =   '<img border=0 src=\'<?=  $cUlrImagenes ?>/abajo.gif\' />' ;
	}
}
</script>
<?
	$aRoles = $this->oUserSession->getRolArray();
	if ( $cRefresh != 'head' ) echo "<div id='head' >";
	$oMenu = new Menu('body', 'menuhead', 'menu', false, 'sc');
	global $aInstallModules;
	foreach($aInstallModules as $cModulo => $aModulo )
	{
		$cPathMod = $aModulo['cPathModule'];
		if ( $aRoles['all'] || $aRoles[$cModulo]  )
			if ( $aModulo['cMenu'] != false  || ( !isset($aModulo['cMenu'])  && file_exists( $cPathMod . '/menu_ini.php' ) ) )
				$oMenu->addItem( $cModulo, '?ac=menu&mo=' . $cModulo, 'body');
	}
	
?>
	<div><?=  $cActions; ?></div>
	<div><a  onclick='Javascript: swapMenu(this); ' href='javascript: void(0);' ><img class='accion3' alt='Ver u ocultar el Menu' src='<?=  $cUlrImagenes ?>/siguiente.gif' /></a></div>
	<div>
	<?
		if ( $this->oUserSession->isLogged() )
			echo $oMenu->makeHTML();
		else
		{
			echo "<a href='?" . PARAM_MODULE . '=seguridad&amp;' .  PARAM_ACTION . '='  . INGRESAR_AL_SISTEMA . "' >Ingresar</a>";
		}
	?>
	</div>
<?
	if ( $cRefresh != 'head' ) echo "</div>";
?>